<?php
$searchterm = $_GET['code'];
$searchterm = ereg_replace((" "),"+",$searchterm);
$way = $_GET['code2'];

If($way == "normal"){
$searchpage = "http://www.youtube.com/results?search_type=videos&search_query=".$searchterm."&oq=".$searchterm."&gl=CA";
}

If($way == "lyrics"){
$searchpage = "http://www.youtube.com/results?search_type=videos&search_query=".$searchterm."+lyrics&oq=".$searchterm."+lyrics&gl=CA";
}

If($way == "views"){
$searchpage = "http://www.youtube.com/results?search_type=videos&search_query=".$searchterm."&oq=".$searchterm."&gl=CA&search_sort=video_view_count";
}

			$file = file_get_contents( $searchpage, false, $context);
			echo $file;
?>
